<?php
class my_page {
	var $CI;
	function __construct() {
		$this->CI =& get_instance();
	}

	public function get_pagination($url,$total_nums,$limit,$display_pages=true) {
		$this->CI->load->library('pagination');
		$config['base_url'] 			= $url;
		$config['total_rows'] 			= $total_nums;
		$config['page_query_string'] 	= TRUE;
		$config['num_links'] 			= 7;
		$config['per_page'] 			= $limit;
		$config['display_pages'] =$display_pages;
		$config['prev_link'] = '上一页<b></b>';
		$config['next_link'] = '下一页<b></b>';
		$config['cur_tag_open'] = '<a href="javascript:void(0)" class="current">';
		$config['cur_tag_close'] = '</a>';
		$this->CI->pagination->initialize($config);
		return $this->CI->pagination->create_links();

	}
}